home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / turbotut.arc / LOOPIF.PAS < prev    next >
Pascal/Delphi Source File  |  1989-06-30  |  550b  |  21 lines

  1. PROGRAM loops_and_ifs;
  2.  
  3. VAR count,index : INTEGER;
  4.  
  5. BEGIN (* Main program *)
  6.  
  7.   FOR count := 1 TO 10 DO
  8.   BEGIN (* Main loop *)
  9.     IF count < 6 THEN WRITELN('The loop counter is up to ',count:4);
  10.     IF count = 8 THEN
  11.     BEGIN
  12.       FOR index := 8 TO 12 DO
  13.       BEGIN (* Internal loop *)
  14.         WRITE('The internal loop index is ',index:4);
  15.         WRITE(' and the main count is ',count:4);
  16.         WRITELN;
  17.       END; (* Internal loop *)
  18.     END; (* If count = 8 condition *)
  19.   END; (* Main loop *)
  20.  
  21. END.  (* Main program *)